Skip to content

Conversation

@sergical
Copy link
Collaborator

@sergical sergical commented Jan 17, 2026

Summary

Add complete bracket prediction system with leaderboard, scoring, and social sharing.

Features

  • Interactive Bracket Predictions (/test)

    • Click matchups to select winners through all 4 rounds
    • Lock bracket to submit final predictions (pre-tournament only)
    • Reset predictions before locking
    • React Flow-based visualization with custom retro styling
  • Leaderboard (homepage)

    • Real-time ranking of all players by score
    • Retro scoreboard aesthetic with flip-digit animation
    • Links to view each player's bracket
  • Public Bracket Sharing (/bracket/[username])

    • View any player's locked bracket
    • Dynamic OG images for social sharing
    • Read-only visualization
  • Scoring System

    • Points calculated per round (more points for later rounds)
    • Scores update as tournament results come in
    • Stored in database with proper indexing
  • Countdown Timer

    • Retro-styled countdown to tournament start
    • Disables bracket locking after deadline

Database Schema

New tables added:

  • user_prediction - Stores each user's bracket picks
  • user_bracket_status - Tracks if bracket is locked
  • user_score - Per-round and total scores
  • tournament_result - Official match outcomes (for scoring)

Setup

Database

# Fresh setup (creates single consolidated migration)
pnpm db:setup

Environment Variables

Ensure .dev.vars has:

GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
BETTER_AUTH_SECRET=your_random_secret
BETTER_AUTH_URL=http://localhost:3000

Testing

  1. pnpm dev
  2. Go to http://localhost:3000 - see countdown and leaderboard
  3. Click "Sign in to Play" → redirects to GitHub OAuth
  4. After auth, go to /test to make predictions
  5. Click matchups to pick winners through finals
  6. Lock bracket to submit
  7. Visit /bracket/[your-github-username] to see public view

🤖 Generated with Claude Code

@sergical sergical changed the title Add bracket predictions with retro-styled login card Add bracket predictions Jan 17, 2026
@sergical sergical force-pushed the sergical/bracket-picking branch 2 times, most recently from e7d12f4 to cb4ee69 Compare January 26, 2026 00:55
sergical and others added 22 commits January 26, 2026 16:49
- Add /test route with bracket prediction functionality
- Add predictions API endpoints and usePredictions hook
- Redesign login card with 1991 retro paper-cut aesthetic
- Fix bracket finalist node centering

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Restore view-only Bracket.tsx from main for index page
- Create InteractiveBracket.tsx with picking functionality
- Update test.tsx to use InteractiveBracket
- Use single yellow ring color instead of left/right colors
- Make placeholders gray with grayscale filter
- Players only grayscale when eliminated

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- API now deletes existing predictions before inserting new ones
- Reset + save now actually clears predictions from database
- Match FIT_VIEW_PADDING between Bracket and InteractiveBracket

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Merge InteractiveBracket.tsx into Bracket.tsx with isInteractive prop
- Non-interactive mode (homepage): all TBD slots, yellow/red rings, 50px sizing, no grayscale
- Interactive mode (/test): predictions-based, gray rings for TBD, larger finalist/championship sizing
- Delete InteractiveBracket.tsx (logic merged into Bracket.tsx)
- Update test.tsx to use Bracket with isInteractive prop

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Redirect to /test after GitHub OAuth login
- Auto-scroll to #bracket section after login (once per session)
- Clear scroll flag on logout
- Add trustedOrigins for CSRF protection
- Add GitHub OAuth setup docs to CLAUDE.md
- Update players: add Cassidy Williams, Josh Comeau, Kyle Cook

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add DSEG7Classic font for seven-segment LED display
- Create Scoreboard component with individual digit boxes
- Add inactive segment "8" outline behind active digits
- Include corner rivets and CRT scanline overlay
- Add responsive styles for mobile breakpoints
- Style urgent state with glow animation

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Simple 3-column layout (Rank, Player, Total) styled like a classic
arcade high score table with LED digit display.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add userScore table for tracking bracket predictions
- Add scoring utility for calculating points
- Render Leaderboard on test page

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add retro scoreboard countdown component
- Add seed script for testing leaderboard
- Update LoginSection styling

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add shareable bracket routes and API
- Add OG image generation for user brackets
- Update leaderboard and scoreboard components
- Add share bracket styles
- Update DB schema and migrations

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Chained .where() calls only apply the last condition. Combined them
using and() to correctly fetch the user's final game prediction.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Style React Flow controls with dark theme (black bg, yellow accents)
- Stack finalists and championship vertically with centered text
- Add progressive photo sizing: finalists 65px, championship 80px
- Center championship node between finalists
- Add mobile responsive styles

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add DSEG7Classic font for seven-segment LED display
- Create Scoreboard component with individual digit boxes
- Add inactive segment "8" outline behind active digits
- Include corner rivets and CRT scanline overlay
- Add responsive styles for mobile breakpoints
- Style urgent state with glow animation

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Update finalist selector to match node IDs (final-p1, final-p2)
- Set base photo size to 50px to match bracket-styling

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Consolidate 4 migrations into single fresh migration
- Remove debug console.log/error from Leaderboard component
- Delete unused SimpleBracket component
- Remove outdated TODO comment from Header (logo already SVG)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Disable noImportantStyles globally (needed for React Flow overrides)
- Add biome-ignore for array index key in LeaderboardScore (safe for static digits)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Bracket styling:
- Players start colorful, eliminated players become grayscale
- Smooth transitions for filter and hover effects (0.2-0.3s)
- Coordinated hover animations on pickable players

Prediction feedback:
- Yellow checkmark: pending pick (no result yet)
- Green checkmark: correct prediction
- Red X: incorrect prediction

OG image:
- Remove dev mode redirect, works locally now
- Remove test mode, use real DB data only

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Increase avatar sizes for better visibility in social shares:
- R1: 40px → 55px, QF: 48px → 65px, SF: 56px → 80px
- Finals: 64px → 90px, Champion: 120px → 130px

Expand R1 Y range from 182-497px to 50-582px to use full
canvas height, allowing avatars to extend into logo/footer
areas for maximum visual impact.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove Ticket component from share page layout
- Remove champion pick display from header
- Use TanStack Router's notFound() for missing/unlocked brackets
- Move CTA button into header card
- Clean up unused CSS styles

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Change [data-id*="final-p"] to [data-id*="finalist"]
- Matches left-finalist and right-finalist node IDs

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add .player-node__badge base styles
- Add --pending, --correct, --incorrect variants
- Use CSS variables for colors

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@sergical sergical force-pushed the sergical/bracket-picking branch from 4f85a42 to f83058b Compare January 26, 2026 21:59
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 26, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
mad-css f83058b Commit Preview URL

Branch Preview URL
Jan 26 2026, 10:03 PM

@sergical sergical closed this Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant